{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1595
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var 
	i,j,n:longint;
	a:array[0..1010,0..1010] of longint;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=1 to n do
	for j:=1 to n do
		read(a[i][j]);
for j:=1 to n do begin
	for i:=n downto 1 do
		write(a[i][j],' ');
	writeln;
end;	
end.